import axios from "axios";
import nProgress from "nprogress";
import 'nprogress/nprogress.css';

const wyRequest = axios.create({
  baseURL: '/wy',
  timeout: 5000
});

wyRequest.interceptors.request.use((config) => {
  nProgress.start();
  return config;
}, (err) => {

  return Promise.reject(err);
})

wyRequest.interceptors.response.use((response) => {
  nProgress.done();
  return response.data;
}, (err) => {
  return Promise.reject(err);
});

export default wyRequest;